﻿$(document).on("pageInit", "#apply-detail-stu", function (e, id, page) {
    $.getJSON("/apply/GetApplyById/" + $(page).find('[name="id"]').val(), function (response) {
        var statusEnum = {
            2: "审批中",
            3: "已拒绝",
            4: "已通过"
        };
        response.Status = statusEnum[response.Status]
        $(page).setForm(response);
    });

    $(page).find("[name=apply-detail-teacher-form]").on("submit", function (evt) {
        evt.preventDefault();
        $(page).find("[name=apply-detail-teacher-form]").ajaxSubmit({
            success: function (response) {
                if (response.indexOf("err:") > -1) {
                    $.toast(response.substr(4));
                    return false;
                }
                history.back();
            }
        });
    });
});